package com.restaurant.bean;

import lombok.Data;

@Data
public class ResponseResult {
    private Integer code;
    private String message;
    private Object data;

    private ResponseResult() {
    }

    private ResponseResult(Integer code, String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public static ResponseResult success(Object data) {
        return new ResponseResult(200, "success", data);
    }

    public static ResponseResult error(Object data, String message) {
        return new ResponseResult(500, message, data);
    }

    public static ResponseResult error(String message) {
        return new ResponseResult(500, message, null);
    }

}
